<?php

namespace app\api\validate;

use think\Validate;

class HousePark extends Validate
{

    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require',
        'brand' => 'require',
        'address' => 'require',
        //'property_company_name' => 'require',
        //'property_company_mobile' => 'require',
        //'contact_name'    => 'require',
        //'contact_mobile'    => 'require',
        'area'=>'require',
        'floor_num'=>'require',
        'room_num'=>'require',
        'parking_spot_num'=>'require',
        'type'=>'require',
        'house_type'=>'require',
        'complement_id'=>'require',
        'manage_id'=>'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'name' => '请输入园区名称',
        'brand' => '请输入园区品牌',
        'address' => '请选择园区地址',
        //'property_company_name' => '请输入物业公司',
        //'property_company_mobile' => '请输入物业电话',
        //'contact_name'    => '请输入业委会联系人',
        //'contact_mobile'    => '请输入业委会电话',
        'area'=>'请输入占地面积',
        'floor_num'=>'请输入楼栋数量',
        'room_num'=>'请输入套房数量',
        'parking_spot_num'=>'请输入停车位数量',
        'type'=>'请选择房屋类型',
        'house_type'=>'请选择房屋户型',
        'complement_id'=>'请选择园区配套',
        'manage_id'=>'请选择物业管理',
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['name', 'brand', 'address', 'property_company_name', 'property_company_mobile','contact_name','contact_mobile',
            'area','floor_num','room_num','parking_spot_num','type','house_type','complement_id','manage_id'],
        'edit' => ['name', 'brand', 'address', 'property_company_name', 'property_company_mobile','contact_name','contact_mobile',
            'area','floor_num','room_num','parking_spot_num','type','house_type','complement_id','manage_id'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'name' => __('园区名称'),
            'brand' => __('园区品牌'),
            'address' => __('园区地址'),
            'property_company_name'    => __('物业公司'),
            'property_company_mobile'   => __('物业电话'),
            'contact_name'   => __('业委会联系人'),
            'contact_mobile'   => __('业委会电话'),
            'area'   => __('占地面积/亩'),
            'floor_num'   => __('楼栋数量'),
            'room_num'   => __('套房数量'),
            'parking_spot_num'   => __('停车位数量'),
            'type'   => __('房屋类型'),
            'house_type'   => __('房屋户型'),
            'complement_id'   => __('园区配套'),
            'manage_id'   => __('物业管理'),
        ];

        parent::__construct($rules, $message, $field);
    }

}
